<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h1>对象新增</h1>
		<p>Object.create() 通过现有对象创建一个新的对象</p>
		<p>新对象的原型上源对象的方法和属性</p>
		<p>Object.keys() 获取对象所有键的集合成为一个数组</p>
		<p>Object.values() 获取值的集合</p>
		<p>Object.assign() 合并对象</p>
		
		<script>
		 var obj1 = {name:"mumu",age:18,leg:2};
		 var obj2 = {age:17,job:"teacher"};
		 // 合并复制对象
		 var obj3 = Object.assign(obj1,obj2);
		 console.log(obj3);
		 var vals = Object.values(obj3);
		 
		 console.log(vals);
		 var keys = Object.keys(obj3);
		 console.log(keys);
		 
		 var obj4 = Object.create(obj3);//继承
		 
		 
		</script>
	</body>
</html>
